package space.goldchen.mapstruct.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import space.goldchen.mapstruct.dto.PersonDto;
import space.goldchen.mapstruct.entity.Person;

/**
 * @author 2021
 * @create 2025-04-21 11:24
 */
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface PersonMapper extends BaseMapper<PersonDto, Person>{

    @Mappings({
            // 属性名称一致时，可以省略
            @Mapping(source = "id", target = "idid"),
            @Mapping(source = "name", target = "namename"),
            @Mapping(source = "name", target = "fullName")
    })
    @Override
    PersonDto toDto(Person entity);
}
